<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 只出现一次的数字 -->
    <script>
      var singleNumber = function (nums) {
        let res = 0
        for (let i = 0; i < 32; i++) {
          let count = 0
          for (let item of nums) {
            count += (item >> i) & 1
          }
          if (count % 3 !== 0) {
            res |= 1 << i
          }
        }
        return res
      }
      console.log(singleNumber([2, 2, 3, 2]))
    </script>
  </body>
</html>
